<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msds="http://ehs-info.com/msds" xmlns="http://matsadaml.org/msds/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" exclude-result-prefixes="msds #default">
	<xsl:template match="/">
			<xsl:processing-instruction name="xml-stylesheet">
				<xsl:text>type="text/xsl" href="../System/Transformations/CompanyIndex.xsl"</xsl:text>
			</xsl:processing-instruction>
			<xsl:apply-templates/>
	</xsl:template>
	<xsl:template match="msds:companyDB">
		<companyDB xmlns="http://ehs-info.com/msds/v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ehs-info.com/msds/v1.0 ../System/Schema/msds.xsd">
			<xsl:apply-templates/>
		</companyDB>
	</xsl:template>
	<xsl:template match="msds:company">
		<company key="{msds:name}">
			<contactDetails>
				<xsl:if test="msds:name/text()">
					<companyName><xsl:value-of select="msds:name"/></companyName>
				</xsl:if>
				<address1><xsl:value-of select="msds:street1"/></address1>
				<xsl:if test="msds:street2/text()">
					<address2><xsl:value-of select="msds:street2"/></address2>
				</xsl:if>
				<xsl:if test="msds:street3/text()">
					<address3><xsl:value-of select="msds:street3"/></address3>
				</xsl:if>
				<xsl:if test="msds:postalCode/text()">
					<postCode><xsl:value-of select="msds:postalCode"/></postCode>
				</xsl:if>
				<city><xsl:value-of select="msds:city"/></city>
				<country>Enter full country name here...</country>
				<xsl:if test="msds:telephoneNumber/text()">
					<telephone><xsl:value-of select="msds:telephoneNumber"/></telephone>
				</xsl:if>
				<xsl:if test="msds:faxNumber/text()">
					<fax><xsl:value-of select="msds:faxNumber"/></fax>
				</xsl:if>
				<email>info@<xsl:value-of select="msds:name"/>.com</email>
				<xsl:if test="msds:webAddress/text()">
					<web><xsl:value-of select="msds:webAddress"/></web>
				</xsl:if>
			</contactDetails>
			<custom-items>
				<item name="default-country">SE</item>
				<item name="default-language">sv</item>
				<item name="xsl-html">../../System/Transformations/msds2xhtml.xsl</item>
				<item name="css-screen">../../ResourceFiles/Styles/general.css</item>
				<item name="css-print">../../ResourceFiles/Styles/printgeneral.css</item>
				<item name="xsl-pdf">../../System/Transformations/msds2fo.xsl</item>
			</custom-items>
			<countries>
				<country code="SE">
					<languages>
						<language lang="sv"/>
					</languages>
				</country>
				<country code="UK">
					<languages>
						<language lang="en"/>
					</languages>
				</country>
			</countries>
		</company>
	</xsl:template>
</xsl:stylesheet>
